<?
require_once("../config/dbconn.php");require_once("../config/powercls.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.red{
	color:red
}
-->
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script language="javascript" type="text/javascript" src="../calendar/WdatePicker.js"></script>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td width="935" height="29" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">奖金拨出率</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top">
		<form id="form1" name="form1" method="post" action="user_lst.php?act=query">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
           
            <tr>
              <td height="30">
			  <?
			   //获取公司的会员
			   $sqlgs="select * from {$db_prefix}users where ifnull(tjuser,0)=0 and ifnull(gluser,0)=''";
			   $rsgs=$db->get_one($sqlgs);
			   $gsuserid=$rsgs['id']; $gsyeji=$rsgs['regnum'];
			  ?>
			  <table width="100%" height="120" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="30" align="center" bgcolor="#FFFFFF" class="left_txt">收入</td>
                  <td height="30" bgcolor="#FFFFFF" class="left_txt"><?
				//奖金收入
				$sqlsr="select sum(regnum) as c from {$db_prefix}users where 1";
				$rssr=$db->get_one($sqlsr);
				$allincome=(intval($rssr['c'])+$gsyeji)*$glo_regpv_1;
				//汇款
				$sqlsr="select sum(price) as c from {$db_prefix}huikuan where state=1";
				$rssr=$db->get_one($sqlsr);
				echo $allincome+=$rssr['c'];
				?></td>
                </tr>
                <tr>
                  <td height="30" align="center" bgcolor="#FFFFFF" class="left_txt">支出</td>
                  <td height="30" bgcolor="#FFFFFF" class="left_txt">
				  <?
				  $syssalarystr='';
				  foreach($syssalaryary2 as $k1=>$v1){
				  	if ($syssalarystr!='') $syssalarystr.=',';$syssalarystr.=$k1;
				  }
				  $sqlbc="select sum(price) as c from {$db_prefix}caiwu where type in ({$syssalarystr}) and ptype=3";
				  $rsbc=$db->get_one($sqlbc);
				  echo $salarybc=floatval($rsbc['c']);
				  ?></td>
                </tr>
                <tr>
                  <td height="30" align="center" bgcolor="#FFFFFF" class="left_txt">拨出率</td>
                  <td height="30" bgcolor="#FFFFFF" class="left_txt">
				  <?
				  if ($allincome>0){
				  	echo number_format(($salarybc/$allincome)*100,2)."%";
				  }else{
				  	echo "0%";
				  }
				  ?>				  </td>
                </tr>
                <tr>
                  <td height="30" align="center" bgcolor="#FFFFFF" class="left_txt">&nbsp;</td>
                  <td height="30" bgcolor="#FFFFFF" class="left_txt"><label></label></td>
                </tr>
              </table></td>
            </tr>
            
            <tr>
              <td height="44">&nbsp;</td>
            </tr>
          </table>
		  </form>
		  </td>
      </tr>
    </table></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

</body>
</html>